package cn.itcast.crm.service;

import cn.itcast.crm.domain.Customer;

import javax.ws.rs.*;
import java.util.List;

public interface CustomerService {
    //查询所有未关联的客户列表
    @Path("/noassociationCustomer")
    @GET
    @Produces({"application/xml","application/json"})
    public List<Customer> findNoAssociationCustomers();

    //查询所有已经关联到指定定区的客户列表
    @Path("associationfixedareacustomers/{fixedareaid}")
    @GET
    @Produces({"application/xml","application/json"})
    public List<Customer> findHasAssociationCustomerFixedAreaCutomers(@PathParam("fixedareaid") String fixedAreaId );


    //将客户关联的定区上
    @Path("/associationcustomertofixedarea")
    @PUT
    public void associationCustomersToFixedArea(
            @QueryParam("customerIdStr")  String customerIdStr,
            @QueryParam("fixedAreaId") String fixedAreaId
    );
    
    @Path("/customer")
    @POST
    @Consumes({"application/xml","application/json"})
    public void regist(Customer customer);
    @Path("/customer/telephone/{telephone}")
    @Consumes({"application/xml","application/json"})
    @GET
    public Customer findByTelephone(@PathParam("telephone") String telephone) ;
    
    
    @Path("/customer/updatetype/{telephone}")
    @GET
    public void updateType(@PathParam("telephone") String telephone);

    @Path("customer/login")
    @GET
    @Consumes({"application/xml","application/json"})
    public Customer login(@QueryParam("telephone") String telephone ,@QueryParam("password") String password);

    @Path("/customer/findFixedAreaIdByAddress")
    @GET
    @Consumes({"application/xml","application/json"})
    public  String findFixedAreaIdByAddress (@QueryParam("address") String address);
}



































